package com.example.kotlinlearningproject.utils

import android.content.res.AssetManager
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import java.io.InputStream

class ImageUtil {
    companion object{
        fun loadImageFromAssets(fileName: String, assets: AssetManager): Bitmap? {
            try {
                val inputStream: InputStream = assets.open(fileName)
                return BitmapFactory.decodeStream(inputStream)
            } catch (e: Exception) {
                return null
            }
        }
    }
}